{template 'weheader'}
<script src="{TEMPLATE_WEUI}js/swipe.js"></script>
<script type="text/javascript" src="{TEMPLATE_WEUI}js/picker.js"></script>
<script src="{TEMPLATE_WEUI}js/iscroll.js"></script>
<style type="text/css">
body{background-color:#fff;}
.swiper-container { width: 100%;} 
.swiper-container img { display: block; width: 100%;height:150px;}
{if $setting['list_num']==4}
.weui_grid{width:25%;}
{/if}
.weui_panel_ft:before{height:0px;border-top:0px solid #e5e5e5;}
.weui_panel_ft span{margin-bottom:0px;}
.weui-navigator-list img {width:18px;height:18px;}
.weui-navigator-list a {font-weight:300;font-size:16px;}
.weui-navigator-list li{line-height:45px;}
</style>
<div class="weui_tab_bd">
	{if !empty($slide)}
	<div class="slide" id="slide1">
		<ul>
		{loop $slide $item}
        <li>
            <a href="{$item['link']}">
                <img src="" data-src="{$item['thumb']}" alt="">
            </a>
            <div class="slide-desc">{$item['title']}</div>
        </li>
		{/loop}
		</ul>
		<div class="dot">
			{loop $slide $item}
			<span></span>
			{/loop}
		</div>
	</div>
	{/if}
	{if $category}
	<div id="tagnav" class="weui-navigator weui-navigator-wrapper">
		<ul class="weui-navigator-list">
			<li class="{if empty($id)}weui-state-active{/if}"><a href="{php echo $this->createMobileUrl('index');}">全部</a></li>
			{loop $category $val}
			<li class="{if $val['id']==$id}weui-state-active{/if}"><a href="{php echo $this->createMobileUrl('index', array('id' =>$val['id']));}">{if !empty($val['icon'])}<img class="circle middle" src="{php echo tomedia($val['icon'])}"> {/if}{$val['title']}</a></li>
			{/loop}
		</ul>
	</div>
	{/if}

	{if $list_num==1}
	<div class="weui_panel" style="margin:0;">
		<div class="weui_panel_bd">
		{loop $form $item}
			<div href="{$item['link']}" class="weui_media_box weui_media_appmsg">
				<div class="weui_media_hd open-popup" onclick="show('{$item['reid']}')" data-target="#popup">
					<img class="weui_media_appmsg_thumb radius-sm" src="{php echo tomedia($item['icon'])}" alt="{$item['subtitle']}">
				</div>
				<a class="weui_media_bd" href="{$item['link']}">
					<h4 class="weui_media_title f-black">{$item['subtitle']}</h4>
					<p class="weui_media_desc">{$item['description']}</p>
				</a>
                <div class="weui_panel_ft">
				</div>
			</div>
		{/loop}
		</div>
	</div>
	{else}
		<div class="weui_grids">
		{loop $form $item}
			<a href="{$item['link']}" class="weui_grid js_grid">
				<div class="weui_grid_icon"><img src="{php echo tomedia($item['icon'])}" alt="{$item['subtitle']}"></div>
                <p class="weui_grid_label">{$item['subtitle']}</p>
			</a>
		{/loop}
		</div>
	{/if}
</div>
<div id="popup" class="weui-popup-container" style="z-index:999;">
	<div class="weui-popup-modal"></div>
	<div class="nav"></div>
</div>
<script>
function show(id){
	$.get("{php echo $this->createMobileUrl('getform')}",{id:id},function(data){
		$("#popup .weui-popup-modal").html(data.message.html);
		$("#popup .nav").html(data.message.html2); 
	},"json");
}
$(function(){
	{if !empty($slide)}
	$('#slide1').swipeSlide({
		autoSwipe:true,//自动切换默认是
		speed:3000,//速度默认4000
		continuousScroll:true,//默认否
		transitionType:'cubic-bezier(0.22, 0.69, 0.72, 0.88)',//过渡动画linear/ease/ease-in/ease-out/ease-in-out/cubic-bezier
		lazyLoad:true,//懒加载默认否
		firstCallback : function(i,sum,me){
			me.find('.dot').children().first().addClass('cur');
		},
		callback : function(i,sum,me){
			me.find('.dot').children().eq(i).addClass('cur').siblings().removeClass('cur');
		}
	});
	{/if}
	
	TagNav('#tagnav',{
		type: 'scrollToFirst',
	});
})
</script>
{template 'footers'}